import ollama

question = input("请输入问题：") or "20字介绍北京"

client = ollama.Client(
  host='http://localhost:11434',
  headers={'x-some-header': 'some-value'}
)

response = client.chat(
    model='qwen2.5:3b', 
    messages=[
        {
            'role': 'user',
            'content': question,
        }],
    options={
        "max_tokens": 200,
        "temperature": 0.5,
        "top_p": 0.7,
        }
    )

answer = response['message']['content']

print("问:",question,"?\n答:", answer)